<?php
require_once __Dir__ . '/../simpletest/autorun.php';
require_once __Dir__ . '/../../Core/BonoHomeCore/BonoHomeCoreService.php';

class TestOfGetDocuments extends UnitTestCase 
{
	/*
		Check a correct add answer
	*/
    function testCorrectGetDocuments() 
	{
		$path = "c:/temp"; 
		
		//Get documents with force to refresh
		$service = new BonoHomeCoreService();
		$result = $service->getDocuments($path, true, null);
		$this->assertTrue(count($result->response) > 0);
		
		//Get documents with repository cache
		$result = $service->getDocuments($path, false, null);
		$this->assertTrue(count($result->response) > 0);
    }
	
	
	/*
		Check an invalid add answer
	*/
    function testInvalidGetDocuments() 
	{
		//bad path
		$path = "c:/badpath"; 
		
		$service = new BonoHomeCoreService();
		$result = $service->getDocuments($path, true, null);
		$this->assertTrue($result->response == null);
		$this->assertTrue($result->isFailed == true);
    }
}
?>